package cn.tedu.cool.mapper;

import cn.tedu.cool.entity.Pro;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProMapper {
    @Select("select * from pro")
    List<Pro> select();
    @Delete("delete from pro where id=#{id}")
    void deleteById(int id);
    @Select("select * from pro where title like concat('%',#{wd},'%')")
    List<Pro> selectByWd(String wd);
    @Insert("insert into pro values(null,#{title},#{url},#{price},#{saleCount},#{stock},#{detail},#{categoryId})")
    void insert(Pro pro);
}
